package factoryDesign;

/**
 * @Auther: hdc
 * @Date: 2020/12/5 15:13
 * @Description:
 */
public class SimplePayFactory {
	/**
	 * 根据参数返回对应的对象,注意static
	 * @param payType
	 * @return
	 */

	public static  Pay createPay(String payType){

		if(payType == null){
			return  null;
		}else if(payType.equals("WECHAT_PAY")){
			return  new WeChatPay() ;
		}else if (payType.equals("ALI_PAY")){
			return  new AliPay();
		}
		return  null;

	}
}
